<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			/*
			  属性继承: call()
			  行为继承: 原型对象
			*/
			function Person(name, age) {
				this.name = name;
				this.age = age;
			}

			function Student(name, age, score) {
				// this = new Student("张三", 20, 99)
				Person.call(this, name, age); //给Person中的this赋值
				this.score = score;
			}

            //行为继承
			Student.prototype.study = function() {
				console.log("学习");
			}

			var s1 = new Student("张三", 20, 99);
			var s2 = new Student("李四", 30, 89);
			
			console.log(s1.name);
			s1.study();

			function Worker(salary) {

			}
		</script>
	</head>
	<body>
	</body>
</html>
